package com.hdy.framework.common.dao.impl;

import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import com.hdy.framework.common.dao.CommonDao;
import com.hdy.framework.common.entity.Entity;

public class CommonDaoImpl extends HibernateDaoSupport implements CommonDao{

	public <T> T findById(Long id,Class<T> entityClass){
		return this.getHibernateTemplate().get(entityClass, id);
	}
	
	public Long saveEntity(Entity entity){
		this.getHibernateTemplate().save(entity);
		return entity.getId();
	}
}
